<?php
	session_start();//Khoi tao bien session
	//Khai bao các bien , va gan bang rong
	$url_dir=$url=$host=$user=$pass=$database_name=$page=$id="";
	//Nhung 2 file config.php và thuvien.php
	require_once('configs/config.php');//File luu lai cau hinh của website
	require_once('model/thuvien.php');//File luu tru cac function xu li nghiep vu cua website
	
	$giaodien='fstudio';
	//Gan doi tuong LIB nen bien $lib .
	$lib=new LIB();
	$lib->ketnoi($host,$user,$pass,$database_name);
	$url_dir=$url.'view/'.$giaodien.'/';
	
	if(isset($_SESSION['login'])){
		$login=$_SESSION['login'];
	}elseif(isset($_COOKIE['rememberuser'])){
		$one=$lib->selectall("SELECT * FROM tb_user WHERE id=".$_COOKIE['rememberuser']);
	if(isset($one['id']))$_SESSION['login']=$one;
	$login=$_SESSION['login'];
}

?>